The index can be searched using JSON based queries to the web API allowing access via other clients such as mobile devices, backend servers or custom Javascript.
A standalone application is not provided with SearchUnit, however standard integration with a basic web application is all that is required (otherwise the existing demo projects can be used as a starting point).
When the application is setup, verify that the search is working as desired using the web pages.
Requests should be as follows:
{
"indexDirectory":"~/indexdirectory", //path to the index directory relative to the web application, or absolute server path
"query":"car", //search query, in this case the word 'car'
"resultPage":1, //which page of results to return
"resultsPerPage":10, //number of results to obtain
"locationName":"All", //location category to search in
"contentNames":[], //array of content category name to search in
"securityGroupNames":[], //array of encoded security group names
"filterCollection":[], //array of filter definition objects
"sortBy":null, //filter sort by definition
"language":"", //language of the text that is being searched, this affects spell checking
"customDictionaryPath":"", //path to custom spell checking dictionary
"spellingSuggestionSource":"PresetDictionary"} //dictionary source
Note: If you get this error "Request format is unrecognized for URL unexpectedly ending in ..." then you may need to add the HttpPost protocol to the webservices section of web.config, eg.
<configuration> <system.web> <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> </system.web> </configuration>
Response should be as follows:
{
"d": {
"__type": "SearchResultWrapper:#Keyoti.SearchEngine.Web.AjaxService",
"Edition": 3,
"Exception": null,
"IgnoredWords": [], //words from the stoplist that were not searched for
"LiveDataSamples": null,
"NumberOfResults": 6, //total number of results available (can be more than returned in 'Results' array below)
"QueryKeywords": [ //keywords searched for
"car"
],
"Results": [ //array of search result objects
{ //result object 1
"__type": "ResultItem:#Keyoti.SearchEngine.Search",
"Content": "", //document content category
"CustomData": "", //document Custom Data
"CustomDataDictionary": [], //map of Custom Data if CustomData field is a URI encoded string, see Custom Data section for more info
"KeywordHitMap": [ //information about which words matched in the document
{
"__type": "KeywordHits:#Keyoti.SearchEngine.Utils",
"HitWords": [
"car",
"cars"
],
"Hits": 1,
"Keyword": "car"
}
],
"Location": null, //document location category
"SecurityGroups": [ //document security groups
{
"__type": "SecurityGroupRecord:#Keyoti.SearchEngine.DataAccess",
"Name": "default",
"Root": ""
}
],
"Summary": "...", //document result summary
"Title": "List of cars", //document title
"UriString": "http://lo...", //document URL
"UriStringAsStored": "http://lo...", //the document URL as it is stored in the index
"Weight": 50 //result weight
},
{ //other result objects
...
}
],
"SuggestedSearchExpression": null //spell check corrected search query if applicable
}
}
We have not provided exhaustive documentation on this yet, please email support@keyoti.com with any questions and we will be happy to explain in detail.